import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: 'vueMain',
        redirect: '/home',
        component: () => import('../views/Main.vue'), //相当于import Home from '../views/Home.vue'
    children: [
        {
            path: '/home',
            name: 'home',                              //通过此name与commonAside里的name呼应，可以由下面跳转到home页面
            component:() => import('../views/home')
        },
        {
            path: '/introduce',
            name: 'introduce', //通过此name与commonAside里的name呼应，可以由下面跳转到home页面
            component:() => import('../views/Introduce')
        },
        {
            path: '/link',
            name: 'link', //通过此name与commonAside里的name呼应，可以由下面跳转到home页面
            component:() => import('../views/link')
        },
        {
            path: '/diary',
            name: 'diary', //通过此name与commonAside里的name呼应，可以由下面跳转到home页面
            component:() => import('../views/diary')
        },
        {
            path: '/learn1',
            name: 'learn1',
            component: () => import('../views/learn/learn1.vue') 
        },
        {
            path: '/learn2',
            name: 'learn2',
            component: () => import('../views/learn/learn2.vue') 
        },
        {
            path: '/learn3',
            name: 'learn3',
            component: () => import('../views/learn/learn3.vue') 
        },
        {
            path: '/learn4',
            name: 'learn4',
            component: () => import('../views/learn/learn4.vue') 
        },
        {
            path: '/learn5',
            name: 'learn5',
            component: () => import('../views/learn/learn5.vue') 
        },
        {
            path: '/learn6',
            name: 'learn6',
            component: () => import('../views/learn/learn6.vue') 
        },
        {
            path: '/other1',
            name: 'other1',
            component: () => import('../views/other/other1.vue') 
        },
        {
            path: '/other2',
            name: 'other2',
            component: () => import('../views/other/other2.vue') 
        },
    ]
    },
]

const router = new VueRouter({
    mode: 'hash',
    routes
})

export default router
